import 'regenerator-runtime/runtime'
import {isNode} from './util'

import Code from './mod/code'
import User from './mod/user'
import Signatrue from './mod/signatrue'
import Profile from './mod/profile'
import SSO from './mod/sso'

export class IDOCAccount {
	constructor(options){
		this.code = new Code(options)
        this.user = new User(options)
        this.signatrue = new Signatrue(options)
        this.profile = new Profile(options)
        this.sso = new SSO(options)
	}
	syncLogin = async (...args) => {
		const res = await this.user.login(...args)
				.then(user => this.sso.sync(user))
		return res;
	}
}

export default IDOCAccount;